package com.yilin.tms.order.mapper.goods;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yilin.tms.core.application.PageData;
import com.yilin.tms.core.entity.order.goods.GoodsOrder;
import com.yilin.tms.core.entity.user.account.Account;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 货源Mapper
 *
 * @author zhangjinyuan
 * @date 2022/10/29
 */
@Mapper
@Repository
public interface GoodsOrderMapper extends BaseMapper<GoodsOrder> {

    /**
     * 获取货源列表
     * 排序时sort!=null，筛选时query!=null，按离我最近排序时position!=null
     */
    PageData<GoodsOrder> getGoodsOrderPage(@Param("page") PageData<GoodsOrder> page, @Param("loginUser") Account loginUser,
                                           @Param("query") GoodsOrder query, @Param("statuses") List<Integer> statuses);

}
